import request from '@/router/axios';
// 获取所有工单号得记录
export const getOrderAllList = () => {
  return request({
    url:'/api/data-project/projectmana/getOrderAllList',
    method:'get',
  })
}
// 通过id获取项目实体
export const getProjectById = (id) => {
  return request({
    url:'/api/data-project/projectmana/getProjectById',
    method:"get",
    params:{
      id
    }
  })
}

//根据图号获取产品父类,图纸类型
export const getApplicationByNumber = (drawNumber) => {
  return request({
    url:'/api/data-drawing-number-application/drawingnumberapplication/getApplicationByNumber',
    method:"get",
    params:{
      drawNumber:drawNumber
    }
  })
}

// 获取所有的图纸截图的信息
export const getImgListByUploadId = (id) => {
  return request({
    url:'/api/data-drawing-attach/drawingupload/getImgListByUploadId',
    method:"get",
    params:{
      id
    }
  })
}



// 根据id 查找设备的pdf dwg文件信息
export const getPdfByUploadId = (id) => {
  return request({
    url:'/api/data-drawing-attach/drawingupload/getPdfByUploadId',
    method:'get',
    params:{
      id
    }
  })
}
// 提交审批
export const changeUploadStatus = (ids) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/changeUploadStatus',
    method: 'post',
    params: {
      ids,
    }
  })
}


// 列表展示
export const getList = (current, size, params) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
// 通过表单中设备信息，找到相应的附件信息 attach
export const getThreeByUploadId = (id) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/getThreeByUploadId',
    method:'get',
    params:{
      id
    }
  })
}

// 获取字典表中的值
export const getDictValueList = (code) => {
  return request({
    url: '/api/blade-system/dict/dictionary',
    method:'get',
    params:{
      code
    }
  })
}
export const getDetail = (id) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/detail',
    method: 'get',
    params: {
      id
    }
  })
}
export const remove = (ids) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/submit',
    method: 'post',
    data: row
  })
}
export const update = (row) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/submit',
    method: 'post',
    data: row
  })
}

export const updateDrawingStatus = (drawingUpload) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/updateDrawingStatus',
    method: 'post',
    data:drawingUpload
  })
}

// 上传签名后的图纸信息
export const submitSignAttach = (uploadForm) => {
  return request({
    url: '/api/data-drawing-attach/drawingupload/submitSignAttach',
    method: 'post',
    data: uploadForm
  })
}

export const findDrawingListByUploadId = (uploadId, taskDefinitionKey) => {
  return request({
    url:'/api/data-drawing-attach/drawingupload/findDrawingListByUploadId',
    method:'get',
    params:{
      uploadId,
      taskDefinitionKey
    }
  })
}

export const deleteDrawingAttach = (uploadId, taskDefinitionKey) => {
  return request({
    url:'/api/data-drawing-attach/drawingupload/deleteDrawingAttach',
    method:'get',
    params:{
      uploadId,
      taskDefinitionKey
    }
  })
}

